const path = require('path')

module.exports = {
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',

  configureWebpack: {
    resolve: {
      alias: {
        '@': path.join(__dirname, './src'),
        '@views': path.join(__dirname, './src/views'),
        '@components': path.join(__dirname, './src/components'),
        '@utils': path.join(__dirname, './src/utils'),
        '@css': path.join(__dirname, './src/assets/css'),
      },
    },
  },

  css: {
    loaderOptions: {
      sass: {
        prependData: `@import "~@/assets/css/varibles.scss";@import "~@/assets/css/mixins.scss";`,
      },
    },
  },

  devServer: {
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:8080',
        pathRewrite: {
          '^/api': '/mock',
        },
      },
    },
  },
}
